package demo1.old;



//杯子
class Cup {
    private Goods goods;
    public Cup(String one) {
        this.goods = new Goods(one);
    }
    public void init() {
        System.out.println("杯子初始化完成");
        goods.init();
    }
}

//放入杯子的物品
class Goods {
    private String one;
    public Goods(String one) {
        this.one = one;
    }
    public void init() {
        System.out.println("物品初始化为:" + one);
    }
}

public class old {
    public static void main(String[] args) {
        Cup cup = new Cup("water");
        cup.init();
    }
}
